<?php


require("../library/config.inc.php");
require("../library/Database.singleton.php");
// create the $db singleton object
$db = Database::obtain(DB_SERVER, DB_USER, DB_PASS, DB_DATABASE);
$db->debug = true;
$db->connect();
#zmienne();
$sql="select id, kod, nazwa from sl_icd10 where kod like '".$_POST['q']."%'";


$rows = $db->query($sql);
if($rows){   
        while ($record = $db->fetch($rows)) {
            echo $record['id']."|".$record['kod']."|".$record['nazwa']."\n";  
            }
         }

$db->close();
?>


